const jwt = require("jsonwebtoken");
const algorithm = "HS256";
const secretKey = "uxigtpc9";

const signed = (string) => {
  return jwt.sign(string, secretKey, { algorithm });
};

const verify = (token) => {
  try {
    return jwt.verify(token, secretKey, { algorithm });
  } catch (error) {
    return false;
  }
};

module.exports = {
  signed,
  verify,
};
